﻿using System;
using System.Collections;
using System.Collections.Generic;
namespace WPFExcelReport
{
    class VK02AV95Report : BaseReport
    {
        #region Variable
        byte[] b;
        string MultiRowTable = "WASTGA;WASTPASS;BASTGA;GASTGA;WTLEIST;BASTKE;";
        int WarpBeamEnds11 = 0;
        int TotalEnds = 0;
        int TotalSelvage = 0;
        string ArticleNum;
        string ArticleVar;
        string ArticleColor;
        string ArticleFin;
        string strCompany;
        string strExcelFile;
        double Warpdensity = 1.0;
        double Weftdensity = 1.0;

        double WarpEnds = 1.0;
        double WeftEnds = 1.0;
        double Jdense = 0.0;
        double Wdense = 0.0;
        double TotalDense = 0.0;
        #endregion
        public VK02AV95Report()
            : base()
        {
        }
        public VK02AV95Report(Dictionary<string, object> dicParamater)
            : base(dicParamater)
        {
            ArticleNum = dicParamater["ArticleNum"].ToString().Trim();
            ArticleVar = dicParamater["ArticleVar"].ToString().Trim();
            ArticleColor = dicParamater["ArticleColor"].ToString().Trim();
            ArticleFin = dicParamater["ArticleFin"].ToString().Trim();
            strCompany = dicParamater["Company"].ToString().Trim();
            strExcelFile = dicParamater["ExcelFile"].ToString().Trim();
        }
        public void WriteExcelReport(string fileType)
        {
            Queue CellQueue = new Queue();

            string filename = "";
            string sheetName = "";
            string Standard = "VK02AV95";
            strExcelFile = @"HLT\HLTPlanningReport.xls";
            string filePath = @"C:\intex.w\Report\" + strExcelFile;
            exAgent.Open(filePath);
            exAgent.Company = strCompany;
            exAgent.strExcelFile = strExcelFile;
            string filedate = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString();
            filename = @"Planning\后整理\" + filedate + ".xls";
            sheetName = DateTime.Now.ToShortTimeString().Replace(@":", "");
            exAgent.CreateNewSheet(filename, Standard, sheetName);
            FillInData(columns, dsSource.Tables["ABPOS"]);
            if (exAgent != null)
            {
                exAgent.Save();
                exAgent.Close();
            }
        }
    }

}
